<template>
  <el-table
    ref="multipleTable"
    :data="tableData"
    tooltip-effect="dark"
    style="width: 100%"
    @selection-change="handleSelectionChange">
    <el-table-column
      type="selection"
      width="55">
    </el-table-column>
    <!--    <el-table-column-->
    <!--      label="日期"-->
    <!--      width="120">-->
    <!--      <template slot-scope="scope">{{ scope.row.date }}</template>-->
    <!--    </el-table-column>-->

    <el-table-column prop="outboundCode" label="出库单号" show-overflow-tooltip></el-table-column>
    <el-table-column prop="wareName" label="仓库名称" show-overflow-tooltip></el-table-column>
    <el-table-column prop="outboundName" label="出库类型" show-overflow-tooltip></el-table-column>
    <el-table-column prop="outboundTime" label="出库时间" show-overflow-tooltip></el-table-column>
    <el-table-column prop="userId" label="领用人" show-overflow-tooltip></el-table-column>
    <el-table-column prop="operatorId" label="操作人" show-overflow-tooltip></el-table-column>
    <el-table-column prop="operatorTime" label="操作时间" show-overflow-tooltip></el-table-column>
    <el-table-column prop="status" label="审核状态" show-overflow-tooltip>
      <template slot-scope="scope">
        <span v-if="scope.row.status === 1">有效</span>
        <span v-else-if="scope.row.status === 2">无效</span>
      </template>
    </el-table-column>

    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button
          size="mini"
          @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
        <el-button
          size="mini"
          type="danger"
          @click="handleDelete(scope.$index, scope.row)">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import { getList } from '../../../api/wms/outbound'
export default {
  name: 'index',
  data() {
    return {
      tableData: [],
      multipleSelection: []
    }
  },
  created() {
    this.getTable();
  },
  methods: {
    getTable(){
      getList().then((res)=>{
        this.tableData = res.data;
      })
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
    }
  }

}
</script>

<style scoped>

</style>
